#!/usr/bin/env python
# -*- coding:utf-8 -*-

# 下载地址：https://pypi.python.org/packages/2.7/g/greenlet/greenlet-0.4.9-py2.7-win-amd64.egg#md5=3449dcbdee3d387d1f065f1fd2f6eb88
# 参考《python安装.egg文件》安装

from greenlet import greenlet

def test1():
    print 1
    gr2.switch()
    print 2
    gr2.switch()

def test2():
    print 3
    gr1.switch()
    print 4

gr1 = greenlet(test1)
gr2 = greenlet(test2)
gr1.switch()